package com.sample.prdownloader.slics;

import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.app.Context;

import com.prdownloader.database.AppDbHelper;
import com.prdownloader.database.DbHelper;
import com.prdownloader.database.DownloadModel;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import junit.framework.TestCase;

public class DownloadTaskTest {
    Context context;
    private DbHelper dbHelper;

    @Before
    public void setUp() throws Exception {
        context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        dbHelper= new AppDbHelper(context);
    }
    @Test
    public void onDownloadTask() {
        DownloadModel model = new DownloadModel();
        model.setId(12345678);
        dbHelper.insert(model);
    }
    @After
    public void tearClose() throws Exception {
        dbHelper.remove(12345678);
    }
}